package cn.itcast.clients;

import cn.itcast.config.FeignClientConfiguration;
import cn.itcast.fallback.CastClientFallBackFactory;
import cn.itcast.entity.Order;
import cn.itcast.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;


@FeignClient(value = "cast-service" ,
        configuration = FeignClientConfiguration.class
        ,fallbackFactory = CastClientFallBackFactory.class
)
public interface CastClients {
    @PostMapping("/cast/add")
    Result add(@RequestBody Order order);
    //根据用户id查询用户消费
    @GetMapping("cast/{id}")
    public Double getMoney(@RequestParam Long userId);
}
